package com.kexio.file.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDateTime;

/**
 * 文件信息实体
 * 
 * @author kexio
 */
@TableName("file_info")
public class FileInfo {
    
    /** 文件ID */
    @TableId(type = IdType.AUTO)
    private Long id;
    
    /** 原始文件名 */
    @TableField("original_filename")
    private String originalFilename;
    
    /** 文件扩展名 */
    @TableField("file_extension")
    private String fileExtension;
    
    /** 文件大小（字节） */
    @TableField("file_size")
    private Long fileSize;
    
    /** 文件哈希值（用于秒传和去重） */
    @TableField("file_hash")
    private String fileHash;
    
    /** 内容类型 */
    @TableField("content_type")
    private String contentType;
    
    /** 存储类型 */
    @TableField("storage_type")
    private String storageType;
    
    /** 存储键（文件在存储系统中的唯一标识） */
    @TableField("storage_key")
    private String storageKey;
    
    /** 存储路径 */
    @TableField("storage_path")
    private String storagePath;
    
    /** 业务类型 */
    @TableField("business_type")
    private String businessType;
    
    /** 业务ID */
    @TableField("business_id")
    private String businessId;
    
    /** 上传用户ID */
    @TableField("upload_user_id")
    private Long uploadUserId;
    
    /** 文件状态：0-正常 1-删除 */
    @TableField("status")
    private Integer status;
    
    /** 是否公开访问 */
    @TableField("public_access")
    private Boolean publicAccess;
    
    /** 访问权限配置 */
    @TableField("access_permission")
    private String accessPermission;
    
    /** 下载次数 */
    @TableField("download_count")
    private Integer downloadCount;
    
    /** 最后访问时间 */
    @TableField("last_access_time")
    private LocalDateTime lastAccessTime;
    
    /** 创建时间 */
    @TableField("create_time")
    private LocalDateTime createTime;
    
    /** 更新时间 */
    @TableField("update_time")
    private LocalDateTime updateTime;
    
    /** 删除标记：0-未删除 1-已删除 */
    @TableField("deleted")
    private Integer deleted;

    // ==================== 构造函数 ====================
    
    public FileInfo() {
        this.status = 0;
        this.publicAccess = false;
        this.downloadCount = 0;
        this.deleted = 0;
        this.createTime = LocalDateTime.now();
        this.updateTime = LocalDateTime.now();
    }

    // ==================== Getter/Setter方法 ====================
    
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }

    public String getOriginalFilename() { return originalFilename; }
    public void setOriginalFilename(String originalFilename) { this.originalFilename = originalFilename; }

    public String getFileExtension() { return fileExtension; }
    public void setFileExtension(String fileExtension) { this.fileExtension = fileExtension; }

    public Long getFileSize() { return fileSize; }
    public void setFileSize(Long fileSize) { this.fileSize = fileSize; }

    public String getFileHash() { return fileHash; }
    public void setFileHash(String fileHash) { this.fileHash = fileHash; }

    public String getContentType() { return contentType; }
    public void setContentType(String contentType) { this.contentType = contentType; }

    public String getStorageType() { return storageType; }
    public void setStorageType(String storageType) { this.storageType = storageType; }

    public String getStorageKey() { return storageKey; }
    public void setStorageKey(String storageKey) { this.storageKey = storageKey; }

    public String getStoragePath() { return storagePath; }
    public void setStoragePath(String storagePath) { this.storagePath = storagePath; }

    public String getBusinessType() { return businessType; }
    public void setBusinessType(String businessType) { this.businessType = businessType; }

    public String getBusinessId() { return businessId; }
    public void setBusinessId(String businessId) { this.businessId = businessId; }

    public Long getUploadUserId() { return uploadUserId; }
    public void setUploadUserId(Long uploadUserId) { this.uploadUserId = uploadUserId; }

    public Integer getStatus() { return status; }
    public void setStatus(Integer status) { this.status = status; }

    public Boolean getPublicAccess() { return publicAccess; }
    public void setPublicAccess(Boolean publicAccess) { this.publicAccess = publicAccess; }

    public String getAccessPermission() { return accessPermission; }
    public void setAccessPermission(String accessPermission) { this.accessPermission = accessPermission; }

    public Integer getDownloadCount() { return downloadCount; }
    public void setDownloadCount(Integer downloadCount) { this.downloadCount = downloadCount; }

    public LocalDateTime getLastAccessTime() { return lastAccessTime; }
    public void setLastAccessTime(LocalDateTime lastAccessTime) { this.lastAccessTime = lastAccessTime; }

    public LocalDateTime getCreateTime() { return createTime; }
    public void setCreateTime(LocalDateTime createTime) { this.createTime = createTime; }

    public LocalDateTime getUpdateTime() { return updateTime; }
    public void setUpdateTime(LocalDateTime updateTime) { this.updateTime = updateTime; }

    public Integer getDeleted() { return deleted; }
    public void setDeleted(Integer deleted) { this.deleted = deleted; }
}
